home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM03_C.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  3KB  |  76 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM03_C.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_total_page_count                                    ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function returns the total number of expanded      ;
  7. ;                     memory pages.                                           ;
  8. ;                                                                             ;
  9. ;           PASSED:   &total_page_count:                                      ;
  10. ;                        is a far pointer to the total page count.            ;
  11. ;                                                                             ;
  12. ;         RETURNED:   status:                                                 ;
  13. ;                        is the status EMM returns from the call.  All other  ;
  14. ;                        returned results are valid only if the status        ;
  15. ;                        returned is zero.  Otherwise they are undefined.     ;
  16. ;                                                                             ;
  17. ;                     total_page_count:                                       ;
  18. ;                        is the total number of expanded memory pages.        ;
  19. ;                                                                             ;
  20. ; C USE CONVENTION:   unsigned int status;                                    ;
  21. ;                     unsigned int total_page_count;                          ;
  22. ;                                                                             ;
  23. ;                     status = get_total_page_count (&total_page_count);      ;
  24. ;-----------------------------------------------------------------------------;
  25. .XLIST
  26. PAGE    60,132
  27.  
  28. IFDEF SMALL
  29.    .MODEL SMALL, C
  30. ENDIF
  31. IFDEF MEDIUM
  32.    .MODEL MEDIUM, C
  33. ENDIF
  34. IFDEF LARGE
  35.    .MODEL LARGE, C
  36. ENDIF
  37. IFDEF COMPACT
  38.    .MODEL COMPACT, C
  39. ENDIF
  40. IFDEF HUGE
  41.    .MODEL HUGE, C
  42. ENDIF
  43.  
  44. INCLUDE emmlib.equ
  45. INCLUDE emmlib.str
  46. INCLUDE emmlib.mac
  47. .LIST
  48. .CODE
  49.  
  50. get_total_page_count    PROC                                                  \
  51.             ptr_total_page_count:FAR PTR WORD
  52.  
  53.     ;---------------------------------------------------------------------;
  54.     ;   do;                                                               ;
  55.     ;   .   get total & unallocated page count from EMM;                  ;
  56.     ;---------------------------------------------------------------------;
  57.     MOVE        AH, get_unalloc_page_cnt_fcn
  58.     INT         EMM_int
  59.  
  60.     ;---------------------------------------------------------------------;
  61.     ;   .   pass total page count back to the caller;                     ;
  62.     ;---------------------------------------------------------------------;
  63.     MOVE        ES:BX, ptr_total_page_count
  64.     MOVE        ES:[BX], DX
  65.  
  66.     ;---------------------------------------------------------------------;
  67.     ;   .   return (EMM status);                                          ;
  68.     ;   end;                                                              ;
  69.     ;---------------------------------------------------------------------;
  70.     RET_EMM_STAT    AH
  71.  
  72. get_total_page_count    ENDP
  73.  
  74. PAGE
  75. END
  76.